home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-01-03 | 857 b | 38 lines | [TEXT/MPS ] |
- c
- c StackGrow
- c
- c This program demonstrates how a FORTRAN
- c program can enlarge its own stack.
- c
- c 3 toolbox calls are used: StackSpace, GetApplLimit,
- c and SetApplLimit.
- c
- c Note: Language Systems FORTRAN v3.0 automatically
- c adjusts the stack to 10% of the total partition
- c size. The stack is initially set by the System
- c to 24K on MacII-class machines.
- c
- !!mp inlines.f
- program StackGrow
- call addmenuitem('Stack','Report Stack Size',report)
- call addmenuitem('Stack','Enlarge Stack 32K',grow32)
- end
-
- subroutine report
- write(*,*)
- write(*,*) 'Size of stack is ',StackSpace()
- end
-
- subroutine grow32
- integer*4 j
- j = GetApplLimit() ! max size of heap
- call SetApplLimit(int4(j-32768))
- if (MemError = 0) then
- write(*,*)
- write(*,*) 'Stack grow successful!'
- else
- write(*,*)
- write(*,*) 'Stack could not be grown!!'
- end if
- end
-